<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const allProducts = [
            {id: 1, name: 'A1', price: 20},
            {id: 2, name: 'A2', price: 30},
            {id: 3, name: 'A3', price: 35},
            {id: 4, name: 'B1', price: 40},
            {id: 5, name: 'B2', price: 35}
        ] 
        const products = allProducts.filter(p => p.name.includes('A') )
        console.log(products);

        let arr1 = 'A1';
        console.log(arr1.includes("A"));
    </script>
</body>
</html>